<?php
	session_name('usuario');
	session_start();
	$id=base64_decode($_GET['nume']);
	$id=$_GET['nume'];
	//if ($id == '')
		//header("location:animales.php");
	if($_SESSION['usuario'] == '' || $_SESSION['idusuario'] == '')
		header("location:login.php?error=1");
	$id_user=base64_encode($_SESSION['idusuario']);
	include("datos.php");
	include("fecha.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Historial Control Lechero</title>
    <!--Hojas de Estilos -->
	<link href="CSS/style.css" rel="stylesheet" type="text/css" media="screen, projection"/>
	<link href="CSS/resultados.css" rel="stylesheet" type="text/css" />
	<link href="CSS/estilo_jquery.css" rel="stylesheet" type="text/css" />
	<script src="js/tabla.js" type="text/javascript" ></script>

	<!--jquery validate-->
	<!--<script src="jquery/jquery-validate/lib/jquery.js" type="text/javascript"></script>-->
	<script src="jquery/jquery-validate/jquery.validate.js" type="text/javascript"></script>
	
	<!--css calendar-->
	<link rel="stylesheet" type="text/css" href="JSCalendar/css/jscal2.css" />
	<link rel="stylesheet" type="text/css" href="JSCalendar/css/border-radius.css" />
	<link rel="stylesheet" type="text/css" href="JSCalendar/css/steel/steel.css" />
	<script src="JSCalendar/js/jscal2.js"></script>
	<script src="JSCalendar/js/lang/es.js"></script>
    
    <!--highcharts-->
	<script type="text/javascript" src="jquery/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="highcharts/highcharts.js"></script>
    
    
	<!--Add the JavaScript to initialize the chart on document ready -->
	<script type="text/javascript">
		$(document).ready(function() {
			

			var options = {
				chart: {
					renderTo: 'container',
					type: 'column'
				},
				title: {
					text: 'Registro de la cantidad de mililitros de leche producida por el animal'
				},
				xAxis: {
					categories: []
				},
				yAxis: {
					title: {
						text: 'ml'
					}
				},
				series: []
			};
			
			// Load the data from the XML file 
			//var idtag = jQuery("#search_cd").val();
			var idtag= jQuery("#idtag").val();
			$.get('historial_lecheroSQL.php?tag='+idtag, function(xml) {
				
				// Split the lines
				var $xml = $(xml);
				
				// push categories
				$xml.find('categories item').each(function(i, category) {
					options.xAxis.categories.push($(category).text());
				});
				
				// push series
				$xml.find('series').each(function(i, series) {
					var seriesOptions = {
						name: $(series).find('name').text(),
						data: []
					};
					
					// push data points
					$(series).find('data point').each(function(i, point) {
						seriesOptions.data.push(
							parseInt($(point).text())
						);
					});
					
					// add it to the options
					options.series.push(seriesOptions);
				});
				var chart = new Highcharts.Chart(options);
			});
		});
	</script>
    
    
     
	<script language="javascript" type="text/javascript">
    function confirmar(){
        var agree=confirm("Realmente desea salir? ");
        if (agree) return true ;
        else return false ;
    }
	</script>
</head>

<body>
<div id="wrap">
   <div id="header">
    <!--<img src="images/BioMedic.jpg" class="logo" />-->
	 <ul class="lista-top">
	   <li><?php echo $_SESSION['usuario'];?></li>|
       <?php if($id_user!=0){ ?>
	   <li><a href="modificar_profesional.php?nume=<?php echo $id_user; ?>">EDITAR</a></li>|
       <?php } ?>
	   <li><a href="logout.php" onclick="return confirmar()">SALIR</a></li>
	 </ul>
   </div>
   <?php include("menu2.php");?>
   <div>
	<a id="submenu" href="modificar_animal.php?nume=<?php echo $id; ?>">Datos del Animal</a>
    <a id="submenu" href="historial_peso.php?nume=<?php echo $id; ?>">Historial de Peso</a>
    <a id="submenu" style="background: none repeat scroll 0 0 #EEEEEE;
    border: 1px solid #999999; border-radius: 5px 5px 5px 5px;" href="historial_lechero.php?nume=<?php echo $id; ?>">Historial Lechero</a>
   </div>
   <br />
   
   <div id="titlehead">
     <!--H1 para el nombre de la seccion-->
     <h1 class="title">Historial Control Lechero</h1>
	 <!--Formulario de Busqueda-->
   </div>
    <div id="content">
    <br />
	<br />
	<br />
	<br />
      
    <div id="container" style="width: 800px; height: 400px; margin: 0 auto"></div>
    <input type="hidden" name="idtag" id="idtag" value="<?php echo $id; ?>" />
	</div>
	<br />
	<br />

   <div id="footer">
   <center>
   <br />
   <label style="color:#FFF">Copyright &copy; 2012 COLISA. Todos los derechos reservados.</label>
   </center>
   </div>
</div>
</body>
</html>